#import <UIKit/UIKit.h>
#import "MapGenericSearchView.h"
#import "MapBuildingSearchDelegate.h"
#import "SFUConstants.h"

/**
 * A MapBuildingSearchView is an object representing the view that 
 * displays a list of buildings by which to search for on the map.
 *
 * A MapBuildingSearchDelegate must be set to respond to events from
 * the map building search viewer.
 *
 * @author      James Lin
 * @version     0.8.2
 * @since       0.8.2
 * @see         MapBuildingSearchDelegate
 */
@interface MapBuildingSearchView : UIViewController <MapGenericSearchView> {
	id<MapBuildingSearchDelegate> delegate;          // Delegate handling building search events
	NSMutableArray*               buildingList;      // Data source for the table of buildings
	UITableView*                  buildingTableView; // Table of buildings
	UINavigationController*       parentNav;         // The parent navigation controller
}

/**
 * Retrieve the shared instance of the map building search view.
 *
 * @return  the shared instance of MapBuildingSearchView
 */
+ (MapBuildingSearchView*)sharedMapBuildingSearchView;

/**
 * Get the delegate handling events from this view.
 *
 * @return  the delegate handling events from this view
 * @see     MapGenericSearchView
 */
- (id<MapBuildingSearchDelegate>)delegate;

/**
 * Set the delegate handling events from this view.
 *
 * @param theDelegate  the delegate handling events from this view
 * @see                MapGenericSearchView
 */
- (void)setDelegate:(id<MapBuildingSearchDelegate>)theDelegate;

/**
 * Display the table listing of buildings in a new view.
 *
 * Pushes this view onto the navigation controller stack of the parent
 * view. Upon tapping the back button, the view is automatically 
 * popped off the top of the navigation stack.
 *
 * @param buildings      the list of buildings to display
 * @param navController  the navigation controller of the parent view
 */
- (void)displayViewWithBuildings:(NSArray*)buildings 
				   navController:(UINavigationController*)navController;

@end
